<template>
    <view class="pub_page pub_page_bg pub_ecology pub_header_padding pub_tabbar_padding">
        <pub-tabbar :active="2"></pub-tabbar>
        <pub-head headerName="demo" :headerConfig="headerConfig"></pub-head>
        <div class="pub_page_scroll page_box">
            <div class="lis_div_1">
                <div class="title">人脉生态</div>
                <div class="li li_1" @click="listClick('jump','/pages/ecology/tree_two')">
                    <div class="p_1">人脉之树</div>
                    <div class="p_2">立即前往</div>
                </div>
                <div class="li li_2 li_o" @click="listClick('jump','/pages/crystal/index')">
                    <div class="p_1">人脉商城</div>
                    <div class="p_2">立即前往</div>
                </div>
            </div>
            <div class="lis_div_2" @click="listClick('jump','')">
                <div class="li_1"></div>
                <div class="li_2"></div>
                <div class="li_3"></div>
            </div>
            <div class="lis_div_1 lis_div_3">
                <div class="title">游戏生态</div>
                <div class="li li_3" @click="listClick('jump',dts_url)">
                    <div class="p_1">大逃杀</div>
                    <div class="p_2">立即前往</div>
                </div>
                <div class="li li_4 li_o" @click="listClick('jump','/pages/redPacket/index')">
                    <!-- <div class="p_1">话匣子游戏交易</div> -->
                    <!-- <div class="p_2">立即前往</div> -->
                </div>
                <div class="li li_5 li_o" @click="listClick('jump','')">
                    <div class="p_1">方块大战</div>
                    <div class="p_2">立即前往</div>
                </div>
                <div class="li li_6" @click="listClick('jump','')">
                    <div class="p_1">飞机大战</div>
                    <div class="p_2">立即前往</div>
                </div>
                <div class="li li_7 li_o" @click="listClick('jump','')">
                    <div class="p_1">塔防游戏</div>
                    <div class="p_2">立即前往</div>
                </div>
                <div class="li li_8" @click="listClick('jump','')">
                    <div class="p_1">单场竞猜</div>
                    <div class="p_2">立即前往</div>
                </div>
            </div>
            <br>
        </div>
    </view>
</template>

<script>
export default {
    data() {
        return {
            headerConfig: {
                title: '生态',//标题栏内容
                title_color: '#fff'
            },
            dts_url: ''
        };
    },
    onLoad() {
        this.getConfig();
    },
    methods: {
        async getConfig() {
            let configRes = await getApp().getConfigList();
            // console.log(configRes);
            this.dts_url = configRes.isOpenGame == 1 ? '/pages/gameDts/page/game' : ''
        },
        listClick(type, data_1) {
            switch (type) {
                case 'jump':
                    if (data_1) {
                        this.$comFun.openWin(data_1);
                    } else {
                        this.$comFun.toast('敬请期待');
                    }
                    break;
            }
        }
    },
};
</script>

<style lang="scss" scoped>
@import "@/common/css/ecology.scss";
</style>
